<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>盘点管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/logic/whcheck";
		var basic_WUrl="yd/logic/whcheck";
		var basic_Title="盘点管理";
		var show_Width=1000;
		var show_Hight=500;
		var grid;
		function createSearch(){
			init(1,8,'100,100,100,100,100,100,100,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","盘点单据编号：");
			addCommon(0,1,"txtlike","zd001WhCode");
			addCommon(0,2,"lable","任务单据编号：");
			addCommon(0,3,"txtlike","zd002TackCode");
			addCommon(0,4,"lable","盘点仓库：");
			addCommon(0,5,"selectEnum","zd001WhName","<option></option><c:forEach var="s" items="${wh}"><option value='${s.name}'>${s.name}</option></c:forEach>");
			addCommon(0,6,"lable","盘点人：");
			addCommon(0,7,"txtlike","zd004Agent"); 
			
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/list.do");
		}
		
		function addpd(){
			var url = basic_WUrl+"/operate/add/0.do";
			
			ShowIframeDialog("operate",basic_Title,url,show_Width,show_Hight);
		}
		function Importexcel(){
			var url = basic_WUrl+"/upload.do";
				ShowIframeDialog("operate","上传excel",url,show_Width,show_Hight);
				//	window.location.href=basic_Url+"/upload.do";
		}
		
		$(function(){
			grid = $("#table1").ligerGrid({
		        columns: [
		                  { display: '盘点单据编码', name: 'zd002TackCode', width: 240 },
		                  /* { display: '任务单据编码', name: 'zd002TackCode', width: 240 }, */
		                  { display: '盘点仓库', name: 'zd001WhName', width: 200},
		                  { display: '盘点人', name: 'zd004Agent', width: 200},
		                  { display: '盘点时间', name: 'bizModifyDate', width: 200,
		                	  render: function (item){
		                		  var cdate=new Date(item.bizModifyDate);
		                		  return formatDate(cdate,"yyyy-MM-dd")
		                	  }}
		                  ],
		                  enabledEdit: true,
		                  usePager: true,
		                  pageSize:15,
		                  pageSizeOptions :[15,25,35],
		                  rownumbers:true,
		                  url:basic_Url+"/list.do",
		                  width: "100%", height:'100%', checkbox: false,
		                  enabledSort:false,
	                      onDblClickRow : function (data, rowindex, rowobj){
	                    	  var url = basic_WUrl+"/operate/edit/"+data.id+".do";
	                    		ShowIframeDialog("operate",basic_Title,url,show_Width,show_Hight);
	                       }
		                  });
			$("#pageloading").hide();
			});
		
		 /* function checkdel(){
			var manager = $("#table1").ligerGetGridManager(); 
			var rows = manager.getSelectedRow();
			if (rows==null){
				$.dialog.alert('请选择需要操作删除的行！');
				return;
			}
			if (rows.billstatus==1){
				del();
			}else {
				$.dialog.alert('此行不能进行删除操作！');
				return;
			}
			
		}  */
	</script>
	
  </head>
 <body style="padding:10px" onLoad="createSearch()">  
       <div id="layout1">
          <div class="panelBar">
	            <ul class="toolBar">
		           <li><a class="add" onclick="addpd()"><span>去盘点</span></a></li>
		      <li><a class="export" onclick="Importexcel()"><span>导入Excel</span></a></li>
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
    </body>
</html>